<script>
	import Permission from '@/common/lib/permission/permission.js'
	import pushJs from '@/common/lib/mixins/uni-push.js'; //推送
	export default {
		mixins: [pushJs],
		data() {
			return {
				openGif: '',
				platform:'',
				time:0
			};
		},
		onLaunch: function() {
			this.platform = uni.getSystemInfoSync().platform;
			setTimeout(function() {
				plus.navigator.closeSplashscreen();
			}, 4000);
			this.$tools.removeStorage('field_hideTime')
			/* 推送监听 */
			this.initPushListener();
		},
		onShow: function() {
			console.log('App Show');
			if(this.platform === 'ios'){
				let hideTime = 0;
				if(!this.$tools.emptyValid(this.$tools.getStorageSync('field_hideTime'))){
					hideTime = Number(this.$tools.getStorageSync('field_hideTime'))
				}
				let nowTime = Date.parse(new Date());
				if(nowTime - hideTime > 600000 && hideTime>0){  //后台运行10分钟重启app
					plus.runtime.restart();
				}
			}
		},
		onHide: function() {
			console.log('App Hide');
			if(this.platform === 'ios'){
				let timestamp = Date.parse(new Date());
				this.$tools.setStorage('field_hideTime',timestamp)
			}
		},
		methods: {
			
		}
	};
</script>

<style lang="scss">
	/* #ifndef APP-PLUS-NVUE */
	@import url('./common/common-style.scss');
	@import 'static/icon/iconfont.css';
	@import 'static/icon/main.css';
	@import "colorui/main.css";
	@import "colorui/icon.css";
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
	@import "common/css/custom-common.scss";
	.clamp {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		display: block;
	}

	/*边框*/
	.b-b,
	.b-t {
		position: relative;
	}

	.b-b:after,
	.b-t:after {
		position: absolute;
		z-index: 3;
		left: 0;
		right: 0;
		height: 0;
		content: '';
		transform: scaleY(.5);
		border-bottom: 1px solid $hub-color-divider-line;
	}

	.b-b:after {
		bottom: 0;
	}

	.b-t:after {
		top: 0;
	}

	/* #endif*/
</style>
